﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using SharpArch.NHibernate;

namespace ExBlogger.Tests {
    public class TestBase {
        public TestBase() {
            var mappingAssemblyPath = System.Reflection.Assembly.GetAssembly(typeof(ServiceLocatorHelper)).Location;
            var mappingAssemblyDir = Path.GetDirectoryName(mappingAssemblyPath);
            var mappingAssemblyFullName = mappingAssemblyDir + "\\ExBlogger.Repository.dll";
            NHibernateSession.Init(new SimpleSessionStorage(), new[] {mappingAssemblyFullName});
            // Watch NHibernate...
            HibernatingRhinos.Profiler.Appender.NHibernate.NHibernateProfiler.Initialize();

            ServiceLocatorHelper.Init();
        }
    }
}
